<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
  <th:block th:include="include :: header('批量延期申请T')"/>
  <link th:href="@{/ajax/libs/bootstrap-switch/bootstrap-switch.min.css}" rel="stylesheet">
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
  <form class="form-horizontal m" id="form-config-add" name="form-config-add">
    <input type="hidden" name="ids" th:value="${ids}"/>
    <input type="hidden" name="deferState" value="10"/>
    <div class="col-sm-12">
      <div class="form-group">
        <label class="col-xs-4 control-label-new">延期工作日天数：</label>
        <div class="col-xs-8">
          <input type="text" class="form-control" name="deferDays" value="5">
        </div>
      </div>
    </div>
    <div class="col-sm-12">
      <div class="form-group">
        <label class="col-xs-3 control-label-new">延期理由：</label>
        <div class="col-xs-9">
          <select name="delayRc" id="delayRc"
                  th:with="delayRn=${@commonServiceImpl.delayReasonList()}"
                  onchange="dropChgSendTextOnly(this,'delayRn');" required
                  class="form-control m-b phoneCategory">
            <th:block th:each="item : ${delayRn}">
              <option th:text="${item['CSText']}" th:value="${item['CSValue']}"></option>
            </th:block>
          </select>
          <textarea id="delayRn" name="delayRn" maxlength="3500"
                    class="form-control opinion"
                    rows="3"
                    style="height: 130px" required="required"></textarea>
        </div>
      </div>
    </div>
    <div class="row" style="margin-top:50px;">
      <div class="col-xs-offset-5 col-xs-10">
        <button type="button" class="btn btn-sm btn-primary" onclick="submitHandler()"><i class="fa"></i>申 请</button>&nbsp;
      </div>
    </div>
  </form>
</div>
<th:block th:include="include :: footer"/>
<script th:src="@{/ajax/libs/bootstrap-switch/bootstrap-switch.min.js}"></script>
<script type="text/javascript">
  var prefix = ctx + "system/mInterior/cmnFile";

  $("#form-config-add").validate({
    rules: {
      onkeyup: false,
      deferDays: {
        number: true,
        range: [1,5]
      },
    },
    focusCleanup: true
  });

  function submitHandler() {
    if ($.validate.form()) {
      var data = $('#form-config-add').serializeArray();
      $.operate.save(prefix + "/tDeferBatchAddJson", data);
    }
  }

</script>
</body>
</html>
